home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2004 #9 / Amiga Plus CD - 2004 - No. 09.iso / amigaplus / tools / dev_libs / feelin040718 / demos / dragdrop.e < prev    next >
Text File  |  2004-08-03  |  2KB  |  76 lines

  1. OPT PREPROCESS
  2.  
  3. MODULE 'feelin','libraries/feelin','a4',
  4.        'intuition/intuition',
  5.        'graphics/rastport','graphics/gfxmacros','graphics/regions'
  6.  
  7. PROC main()
  8.    DEF fcc:PTR TO feelinClass,
  9.        app,win
  10.  
  11.    sys_SGlob()
  12.  
  13.    IF feelinbase := OpenLibrary('feelin.library',FV_VERSION)
  14.       IF fcc := F_CreateClassA([FA_Class_SuperName,   FC_Text,
  15.                                 FA_Class_Dispatcher,  {myDispatcher},
  16.                                 TAG_DONE])
  17.          app := AppObject,
  18.             Child, win := WindowObject,
  19.                FA_Window_Title, 'Feelin : Drag\an\aDrop',
  20.                FA_Window_Open,   TRUE,
  21.  
  22.                Child, HGroup,
  23.                   Child, TextObject,
  24.                      FA_Frame,           'FP_Button_Frame',
  25.                      FA_Back,            'FP_Button_Back',
  26.                      InputRelease,        FA_UserData,'Pouic Pouic\n',
  27.                      FA_Draggable,TRUE,   FA_Font,'FP_Font_Big',
  28.                      FA_Text,             'Drag Me',
  29.                      FA_Text_VCenter,     TRUE,
  30.                      FA_Text_HCenter,     TRUE,
  31.                      End,
  32.                   Child, F_NewObjA(fcc.name,[
  33.                      FA_Back,            'FP_Text_Back',
  34.                      FA_Frame,           'FP_Text_frame',
  35.                      FA_Font,            'FP_Font_Big',
  36.  
  37.                      FA_Dropable,         TRUE,
  38.                      FA_Text,             'Drop on Me',
  39.                      FA_Text_VCenter,     TRUE,
  40.                      FA_Text_HCenter,     TRUE,
  41.                      End,
  42.                End,
  43.             End,
  44.          End
  45.  
  46.          IF app
  47.             F_DoA(win,FM_Notify,[FA_Window_CloseRequest,TRUE, app, FM_Application_Shutdown,0]);
  48.  
  49.             F_DoA(app,FM_Application_Run,NIL)
  50.  
  51.             F_DisposeObj(app)
  52.          ENDIF
  53.  
  54.          F_DeleteClass(fcc)
  55.       ELSE
  56.          WriteF('Unable to create class\n')
  57.       ENDIF
  58.  
  59.       CloseLibrary(feelinbase)
  60.    ENDIF
  61. ENDPROC
  62.  
  63. ->PROC myDispatcher
  64. F_METHOD(myDispatcher)
  65.  
  66.    sys_RGlob()
  67.  
  68.    SELECT method
  69.       CASE FM_DnDBegin;   WriteF('DnDBegin\n')
  70.       CASE FM_DnDFinish;  WriteF('DnDFinish\n')
  71.       CASE FM_DnDReport;  WriteF('DnDReport\n')
  72.       CASE FM_DnDQuery;   WriteF('DnDQuery\n')
  73.       CASE FM_DnDDrop;    WriteF('DnDDrop\n')
  74.    ENDSELECT
  75. ENDPROC F_SUPERDO
  76.